package containers;
import java.util.*;
import static net.mindview.util.Print.*;
enum Month{JANUARY,FEBUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVERMBER}

public class Stacks {
    public static void main(String[] args) {
        Stack<String> stack=new Stack<String>();
        for(Month m:Month.values())
            stack.push(m.toString());
        print("stack = "+stack);
        stack.addElement("The last line");
        print("element 5 = "+stack.elementAt(5));
        print("popping elements:");
        while(!stack.empty())
            printnb(stack.pop());
        LinkedList<String> lstack=new LinkedList<String>();
        for(Month m: Month.values())
            lstack.addFirst(m.toString());
        print("lstack = "+lstack);
        while(!lstack.isEmpty())
            printnb(lstack.removeFirst()+"");
        net.mindview.util.Stack<String> stack2=new net.mindview.util.Stack<String>();
        for(Month m:Month.values())
            stack2.push(m.toString());
        print("stack2 = "+stack2);
        while(!stack.empty())
            printnb(stack2.pop()+" ");
    }
}
